package org.agile4j.patterns.prototype.order;

/**
 * 企业订单对象
 * @author user
 *
 */
public class EnterpriseOrder implements OrderApi {

	/**
	 * 企业名称
	 */
	private String enterpriseName ;
	
	/**
	 * 产品编号
	 */
	private String productId ;
	
	/**
	 * 订单产品数量
	 */
	private int orderProductNum = 0;
	
	@Override
	public int getOrderProductNum() {
		return orderProductNum;
	}

	public void setOrderProductNum(int num) {
		this.orderProductNum = num ;
	}

	public String getEnterpriseName() {
		return enterpriseName;
	}

	public void setEnterpriseName(String enterpriseName) {
		this.enterpriseName = enterpriseName;
	}

	public String getProductId() {
		return productId;
	}

	public void setProductId(String productId) {
		this.productId = productId;
	}

	@Override
	public String toString() {
		return "EnterpriseOrder [enterpriseName=" + enterpriseName + ", productId=" + productId + ", orderProductNum=" + orderProductNum + "]";
	}

//	@Override
//	public OrderApi cloneOrder() {
//		EnterpriseOrder order = new EnterpriseOrder() ;
//		order.setEnterpriseName(enterpriseName);
//		order.setOrderProductNum(orderProductNum);
//		order.setProductId(productId);
//		return order;
//	}

	@Override
	protected Object clone()  {
		Object obj = null ; 
		try {
			obj = super.clone() ;
		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
		}
		return obj;
	}
}
